package demo1;

public class Person implements Cloneable{//空接口，标记当前类可以被克隆
    public String name;

    public Person(String name) {
        this.name = name;
    }

    @Override
    protected Object clone()
            throws CloneNotSupportedException {//不支持克隆异常
        return super.clone();
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                '}';
    }
}
